<?php
$criteria=new CDbCriteria;
$criteria->condition='`t`.`id` != :uid AND `t`.`status`=1 AND `p`.`type_pg`>0';
$criteria->with=array('p','info','pay');
$criteria->params=array(':uid'=>Yii::app()->user->id);
$dataProvider=new CActiveDataProvider('Users',array(
    'criteria'=>$criteria,
    'pagination'=>array(
        'pageSize'=>20,
    ),
));

$msg='';
if(isset($_POST['status'])){
    if(!empty($_POST['status'])) foreach($_POST['status'] as $s_k => $s_v){
        $pay=Pays::model()->findByPk($s_k);
        if(!empty($pay)){
            $pay->status=$s_v;
            $pay->save();
            $msg='付费确认状态更新;'."<br />";
        }
    }
}

if(isset($_POST['open'])){
    if(!empty($_POST['open'])) foreach($_POST['open'] as $o_k => $o_v){
        $p=Profiles::model()->findByPk($o_k);
        if(!empty($p)){
            $p->open=$o_v;
            $p->save();
            $msg.='发布审核状态更新;'."\r\n";
        }
    }
}

if(!empty($msg)){
    $this->oz_info($msg);
    return;
}



$session=new CHttpSession();
$session->open();
$session['i']=1;

?>

<div class="detailContent22 wp" style="min-height: 1335px">
    <table width="100%" cellspacing="0" cellpadding="0" border="0" class="table3 paddingbotton80 ">
        <tbody><tr>
            <th width="10%" bgcolor="#efefef" align="center" class="th1">用户ID</th>
            <th width="10%" bgcolor="#efefef" align="center" class="th1">用户名称</th>
            <th width="13%" bgcolor="#efefef" class="th1">会员类型</th>
            <th width="13%" bgcolor="#efefef" class="th1">付费申请</th>
            <th width="25%" bgcolor="#efefef" align="center" class="th1">付费确认</th>
            <th width="25%" bgcolor="#efefef" align="center" class="th1">发布审核</th>
            <th width="15%" bgcolor="#efefef" align="center">操作指令</th>
        </tr>

        <?php
        if(!empty($dataProvider->data))
            $this->widget('zii.widgets.CListView', array(
                'dataProvider'=>$dataProvider,
                'itemView'=>'_users_pay',
                'ajaxUpdate'=>false,
                'template'=>"{items}\n{pager}",
//        'itemsTagName'=>'ul',
//        'itemsCssClass'=>'tb',
            ));
        ?>
        </tbody></table>
</div>